home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek Games #12
/
GEGA012.iso
/
Jogos de Azar
/
1721-apuesten.swf
/
scripts
/
C_AutoButtonCLASS.as
next >
Wrap
Text File
|
2006-01-17
|
2KB
|
104 lines
_global.C_AutoButtonCLASS = function()
{
this.autoOn = false;
};
C_AutoButtonCLASS.prototype = new MovieClip();
C_AutoButtonCLASS.prototype.onLoad = function()
{
this.a_btn.addAlt(function()
{
if(this._parent.autoOn)
{
this.showAlt("Turn auto start game OFF");
}
else
{
this.showAlt("Turn auto start game ON");
}
}
,function()
{
this.hideAlt();
}
);
this.a_btn.onPress = function()
{
this.hideAlt();
this._parent.onButtonPress();
};
this.a_btn.useHandCursor = true;
this.a_btn._brightness = -50;
this.label_mc._brightness = -50;
this.stopTimer();
};
C_AutoButtonCLASS.prototype.lock = function()
{
this.onRelease = function()
{
};
this.useHandCursor = false;
if(this.autoOn)
{
this.stopTimer();
}
};
C_AutoButtonCLASS.prototype.unlock = function()
{
delete this.onRelease;
delete this.useHandCursor;
if(this.autoOn)
{
this.startTimer();
}
};
C_AutoButtonCLASS.prototype.onButtonPress = function()
{
if(this.autoOn)
{
this.autoOn = false;
this.a_btn._brightness = -50;
this.label_mc._brightness = -50;
this.stopTimer();
}
else
{
this.autoOn = true;
this.a_btn._brightness = 0;
this.label_mc._brightness = 0;
this.startTimer();
}
};
C_AutoButtonCLASS.prototype.stopTimer = function()
{
this.timer_mc._visible = 0;
clearInterval(this._interval);
};
C_AutoButtonCLASS.prototype.startTimer = function()
{
this.timer = 1;
this._interval = setInterval(this,"onTimer",1000);
this.timer_mc.gotoAndStop(1);
this.timer_mc._visible = 1;
};
C_AutoButtonCLASS.prototype.onTimer = function()
{
this.timer = this.timer + 1;
if(this.timer > 16)
{
this.timer = 1;
this.startGame();
}
this.timer_mc.gotoAndStop(this.timer);
};
C_AutoButtonCLASS.prototype.startGame = function()
{
var c = this.client;
c.client[c.handler]();
};
C_AutoButtonCLASS.prototype.setChangeHandler = function(handler, client)
{
this.client = {client:client,handler:handler};
};
ASSetPropFlags(_global,"C_AutoButtonCLASS",131);
Object.registerClass("C_AutoButtonCLASS",C_AutoButtonCLASS);